﻿using System;
using System.ServiceModel.Activation;
using System.Web;
using System.Web.Routing;
using GTServices.Service;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace GTServices.Web
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes();
        }

        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {

            //Adding the routes for the WCF Service endpoints. 
            RouteTable.Routes.Add(new ServiceRoute("SampleService",
             new WebServiceHostFactory(), typeof(SampleService)));

            //Classic MVC Routes being added. 
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }


        private void RegisterRoutes()
        {
            // Edit the base address replacing the "SampleService" string below
         
        }
    }
}
